package com.buddy.syn.block._14;

public class OuterClass {
    static class InnerClass{
       synchronized public void methodA(){
//            synchronized ("其他的锁"){
                for (int i=0;i<10;i++){
                    System.out.println("THREAD NAME= "+Thread.currentThread().getName()+ " i = "+i);
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
//                }
            }
        }

        synchronized public void methodB(){
            for (int i=0;i<20;i++){
                System.out.println("THREAD NAME= "+Thread.currentThread().getName()+ " i = "+i);
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
